<script setup>


import { useRoute } from "vue-router";
import {reactive} from "vue";
import {payOrderService} from "@/api/cartOrder";

const route = useRoute()

let total_amount = reactive(route.query.total_amount);
let out_trade_no=reactive(route.query.out_trade_no);

const payOrder=async() => {
  if (total_amount > 0) {
    let result = await payOrderService(out_trade_no);
    if (result.status === 1) {
      console.log('将支付成功消息传给后端')
    } else {
      console.log('未将支付成功消息成功传给后端')
    }
  }
}
payOrder();


</script>
<template>
<div id="payForm">
  <div id="link_center">
    <p>支付成功</p>

<!--    http://localhost:5173/payForm?charset=GBK&-->
<!--    out_trade_no=423d20f483514a97b685920dbaac2685&-->
<!--    method=alipay.trade.page.pay.return&total_amount=18.50&-->
<!--    sign=Yj3qi4YhOWB%2BGV1unRzDJBMRTmHGxWLLW39cFIPPsG5NSBORgX13u6OSsFPBi8AnsPPwm7u5gt2FAWLIn1r5DtC%2FwNdNfH6pK8FOmC4Xmefi3yOcL71SWDpR%2FRPeQhzPQJQ6xR9otQCkGTXcG53gbZ6DRs8K%2Fh%2B1zdQvSo%2BJ7MG6oCMmCggM5H0qwRR5MGWqDqXoppvzeFQofJLHtLLc9%2FDwKu4wEzvhqHqWmfkuQAulObP5UBNbfzbzM1nmGssksMpov8JtFvydMQpnOoP3Roi6sDyxWwcDAG7XIkKP0HoNK1woQHEttOYz%2F7hn6HGruZnnKrsw6clKs1feCzXRvA%3D%3D&-->
<!--    trade_no=2024050222001472100502958094&-->
<!--    auth_app_id=9021000134696463&-->
<!--    version=1.0&-->
<!--    app_id=9021000134696463&-->
<!--    sign_type=RSA2&-->
<!--    seller_id=2088721031197902&-->
<!--    timestamp=2024-05-02+19%3A31%3A45-->


    <router-link to="/main"><button>Return to Main Menu</button></router-link>
  </div>
</div>
</template>
<style>
#content-center {
  display: flex;
  flex-direction: column; /* 垂直方向排列子元素 */
  align-items: center; /* 垂直居中 */
  justify-content: center; /* 水平居中 */

}

#link_center{
  text-align: center;
}
#link_center p{
  font-size: x-large;
  color: #005e21;
  font-weight: bold;
}
</style>